Skip to main content

Storybook

Command:

$ plz stories

plz can also serve and build your storybook. You still need to add your typical storybook config. Although plz does provide a default config, which includes a couple of handy plugins. By default it is searching the src/.stories.js directory for stories, its recommended that you change this using the storybook config.

I you want to make use of the config you can import it like this.

./storybook/main.js
const config = require('@rexlabs/plz-cli/src/configs/storybook/main');

module.exports = {
...config,
stories: ['../src/**/*.stories.{js,jsx,tsx,mdx}']
};

Default addons in the plz provided config:

port

Same as with serve, the port for the dev server. Again, plz will prompt you if the port is already in use. Defaults to http://localhost:3001.